<style>
    #advertising
    {
        width:90%;
        margin:0 auto;
    }
    .tab-pane > p
    {
        padding:10px;
    }
    .ad-data
    {
        margin-top:10px;
    }
    .btn
    {
        margin-top:10px;
        margin-right:5px;
    }
    .section
    {
        width:300px;
        float:left;
        padding-bottom:10px;
        margin-right:15px;
    }
</style>
<div id="advertising">
<h1>Advertising</h1>
    <input type="hidden" id="tempId" value="">
    <div class="bs-example bs-example-tabs">
      <ul id="myTab" class="nav nav-tabs">
        <li class="<?php echo ($tab == 1)?'active':''; ?>"><a href="#pinoytuner" data-toggle="tab">Pinoytuner Homepage</a></li>
        <li class="<?php echo ($tab == 2)?'active':''; ?> "><a href="#digradio" data-toggle="tab">Dig Radio</a></li>
        <li class="<?php echo ($tab == 3)?'active':''; ?> "><a href="#planetjazz" data-toggle="tab">Planet Jazz</a></li>
          <li class="<?php echo ($tab == 4)?'active':''; ?> "><a href="#riceradio" data-toggle="tab">Rice Radio</a></li>
      </ul>
      <div id="ptTabs" class="tab-content">
        <div class="tab-pane fade <?php echo ($tab == 1)?'active in':''; ?>" id="pinoytuner">
          <div class="section">
              <div class="page-header">
                <h4>Homepage Background <br />(1680X1050)</h4>
                </div>
                <?php foreach($pt_bg as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-1" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-1" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="20-1" >Add New</a>
                
         </div>
          <div class="section">
              <div class="page-header">
                <h4>Digradio Carousel Background</h4>
                </div>
                <h4>None</h4> 
                <hr />
                <a href="#" class="btn btn" data-toggle="modal" data-target="#addModal">Add New</a>
                
         </div>
             <div class="section">
              <div class="page-header">
                <h4>Riceradio Carousel Background</h4>
                </div>
                <h4>None</h4>  
                <hr />
                <a href="#" class="btn btn" data-toggle="modal" data-target="#addModal">Add New</a>
                
         </div>
            <hr style="clear:both;" />
         <div class="section">
              <div class="page-header">
                <h4>Planetjazz Carousel Background</h4>
                </div>
                <h4>None</h4>  
                <hr />
                <a href="#" class="btn btn" data-toggle="modal" data-target="#addModal">Add New</a>
                
         </div>    
        </div>
        <div class="tab-pane fade <?php echo ($tab == 2)?'active in':''; ?>" id="digradio">
          <div class="section">
              <div class="page-header">
                <h4>Top Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($dig_leaderboard_top as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-2" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-2" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="5-2" >Add New</a>
                
         </div>
             <div class="section">
              <div class="page-header">
                <h4>Middle Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($dig_leaderboard_middle as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-2" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-2" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="6-2" >Add New</a>
                
         </div>
             <div class="section">
              <div class="page-header">
                <h4>Bottom Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($dig_leaderboard_bottom as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-2" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-2" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="12-2" >Add New</a>
                
         </div>
            <hr style="clear:both" />
        <div class="section">
              <div class="page-header">
                <h4>Footer Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($dig_leaderboard_footer as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-2" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-2" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="8-2" >Add New</a>
                
         </div>    
           
            <div class="section">
              <div class="page-header">
                <h4>Single Page Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($dig_leaderboard_single as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-2" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-2" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="10-2" >Add New</a>
                
                
         </div>
            <div class="section">
              <div class="page-header">
                <h4>Rectangular Sidebar <br />(250X300)</h4>
                </div>
                <?php foreach($dig_rectangle as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-2" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-2" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="13-2" >Add New</a>
                
         </div>
        </div>
        <div class="tab-pane fade <?php echo ($tab == 3)?'active in':''; ?>" id="planetjazz">
          <div class="section">
              <div class="page-header">
                <h4>Top Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($pj_leaderboard_top as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-3" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-3" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="9-3" >Add New</a>
                
         </div>
             <div class="section">
              <div class="page-header">
                <h4>Middle Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($pj_leaderboard_middle as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-3" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-3" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="17-3" >Add New</a>
                
         </div>
             <div class="section">
              <div class="page-header">
                <h4>Bottom Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($pj_leaderboard_bottom as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-3" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-3" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="18-3" >Add New</a>
                
         </div>
            <hr style="clear:both" />
        <div class="section">
              <div class="page-header">
                <h4>Footer Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($pj_leaderboard_footer as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-3" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-3" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="19-3" >Add New</a>
                
         </div>    
           
            <div class="section">
              <div class="page-header">
                <h4>Single Page Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($pj_leaderboard_single as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-3" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-3" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="11-3" >Add New</a>
                
                
         </div>
            <div class="section">
              <div class="page-header">
                <h4>Rectangular Sidebar <br />(250X300)</h4>
                </div>
                <?php foreach($pj_rectangle as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-3" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-3" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="14-3" >Add New</a>
                
         </div>
        </div>
        <div class="tab-pane fade <?php echo ($tab == 4)?'active in':''; ?>" id="riceradio">
          <div class="section">
              <div class="page-header">
                <h4>Top Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($rice_leaderboard_top as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-4" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-4" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="21-4" >Add New</a>
                
         </div>
             <div class="section">
              <div class="page-header">
                <h4>Middle Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($rice_leaderboard_middle as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-4" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-4" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="22-4" >Add New</a>
                
         </div>
             <div class="section">
              <div class="page-header">
                <h4>Bottom Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($rice_leaderboard_bottom as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-4" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-4" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="23-4" >Add New</a>
                
         </div>
            <hr style="clear:both" />
        <div class="section">
              <div class="page-header">
                <h4>Footer Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($rice_leaderboard_footer as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-4" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-4" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="24-4" >Add New</a>
                
         </div>    
           
            <div class="section">
              <div class="page-header">
                <h4>Single Page Leaderboard <br />(720x90)</h4>
                </div>
                <?php foreach($rice_leaderboard_single as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-4" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-4" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="16-4" >Add New</a>
                
                
         </div>
            <div class="section">
              <div class="page-header">
                <h4>Rectangular Sidebar <br />(250X300)</h4>
                </div>
                <?php foreach($rice_rectangle as $item):?>
                    <div class="ad-data">
                        <?php if($item['strFilename']!=""): ?>
                        <img src="http://ptv5-images.s3.amazonaws.com/<?php echo $item['strFilename']; ?>" style="width:200px;"><br />
                        <?php else: ?>
                        <h5>No Image</h5>
                        <?php endif; ?>
                        <a href="#" class="btn btn-danger removeAd" rel="<?php echo $item['intID']?>-4" >Remove</a>
                        <a href="#" class="btn btn-primary editModalTrigger"  rel="<?php echo $item['intID']?>-4" >Edit Details</a>  
                    </div> 
                <?php endforeach; ?>
                <hr />
                <a href="#" class="btn btn addModalTrigger" rel="15-4" >Add New</a>
                
         </div>
        </div>
      </div>
    </div>
</div>

<!-- Modal -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">New Advertisment</h4>
      </div>
      <div class="modal-body">
          <div>
            <h5>Enabled</h5>
            <select class="add-item" id="add-enumEnabled">
                <option value="enabled">enabled</option>
                <option value="disabled">disabled</option>
            </select>
          </div>
          <div>
            <h5>Link</h5>
            <input type="text" class="add-item" id="add-strLink" />
                
          </div>
          <div id="atc">
            <h5>Attach to Content</h5>
              <select id="add-fk-tb_mas_content">
                  <option value="0">none</option>
                <?php foreach($dig_content as $c):?>
                    <option value="<?php echo $c['intID']; ?>"><?php echo $c['strTitle']; ?></option>
                <?php endforeach; ?>
              </select>
          </div>
          <div>
            <h5>Link to Player</h5>
            <select class="add-item" id="add-enumPlayerLink">
                <option value="none">none</option>
                <option value="digradio">Dig Radio</option>
                <option value="riceradio">Rice Radio</option>
                <option value="planetjazz">Planetjazz</option>
                <option value="yoradio">Yo Radio</option>
            </select>
          </div>
          <input type="hidden" value="" id="add-strFilename">
          <div class="image-upload">
            <img id="addImage" src="" style="width:200px" style="display:none;"><br />
            <a class="various btn btn-primary" id="addUpload" data-fancybox-type="iframe" href="">Upload/Select Image</a>
          </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" id="addCancel" >Cancel</button>
        <button type="button" class="btn btn-primary" id="addSave">Save changes</button>
      </div>
    </div>
  </div>
</div>

<!-- Modal -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Edit Details</h4>
      </div>
      <div class="modal-body">
          <div>
            <h5>Enabled</h5>
            <select class="edit-item" id="edit-enumEnabled">
                <option value="enabled">enabled</option>
                <option value="disabled">disabled</option>
            </select>
          </div>
          <div>
            <h5>Link</h5>
            <input type="text" class="edit-item" id="edit-strLink" />
                
          </div>
          <div id="atc">
            <h5>Attach to Content</h5>
              <select id="edit-fk-tb_mas_content">
                  
              </select>
          </div>
          <div>
            <h5>Link to Player</h5>
            <select class="edit-item" id="edit-enumPlayerLink">
                <option value="none">none</option>
                <option value="digradio">digradio</option>
                <option value="riceradio">riceradio</option>
                <option value="planetjazz">planetjazz</option>
                <option value="yoradio">yoradio</option>
            </select>
          </div>
          <div class="image-upload">
            <img id="editImage" src="" style="width:200px"><br />  
            <a class="various btn btn-primary" id="editUpload" data-fancybox-type="iframe" href="">Change Image</a>
          </div>
          <div>
            <a href="#" id="preview" style="display:none;" class="btn" >Preview</a>
          </div>
          <input type="hidden" value="" id="edit-strFilename">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
        <button type="button" class="btn btn-primary" id="editSave">Save changes</button>
      </div>
    </div>
  </div>
</div>






